### Configuration

The `d-fi.config.json` file is where user data should be saved. The configuration file is not required for most users but sometimes there are advanced users who want to customize the way `d-fi` save files or download items.

You will have to create `d-fi.config.json` in the same directory you execute `d-fi` from. Here is the default.

```js
{
  concurrency: 4,
  saveLayout: {
    track: 'Music/{ALB_TITLE}/{SNG_TITLE}',
    album: 'Music/{ALB_TITLE}/{SNG_TITLE}',
    artist: 'Music/{ALB_TITLE}/{SNG_TITLE}',
    playlist: 'Playlist/{TITLE}/{SNG_TITLE}',
  },
  trackNumber: true,
  coverSize: {
    '128': 500,
    '320': 500,
    flac: 1000,
  },
  cookies: {
    arl:'xxx...',
  },
}
```

This file will also be auto-generated when you set your arl from command using `d-fi -a your_arl`. It is recommended that you set your arl cookie and keep it updated instead of relying on the default value.

### Config Details

> _concurrency_: number <1-50>

- This sets the concurrent download when downloading albums, artists, and playlists. For example, if you set this to `8` the program will download `8` tracks at once. This boosts download speed on a faster connection but don't set this too high for reliability.

> _saveLayout_

- `.track` save structure for single-track downloads.
- `.album` save structure for album downloads.
- `.artist` save structure for artist downloads.
- `.playlist` save structure for playlist downloads.

You can change save structure from command line as well. For example `d-fi -o "{ART_NAME} - {SNG_TITLE}"`. Available values for track, album, artist, and playlist are:

| Key         | Description |          Example Value           |
| :---------- | :---------: | :------------------------------: |
| `ALB_TITLE` | Album Title |            Discovery             |
| `ART_NAME`  | Artist Name |            Daft Punk             |
| `SNG_TITLE` | Track Title | Harder, Better, Faster, Stronger |

There are also additional values available only for the playlist.

| Key     |  Description   | Example Value |
| :------ | :------------: | :-----------: |
| `TITLE` | Playlist Title | wtf playlist  |

You can also find other less recently used values [here](https://github.com/d-fi/d-fi-core/tree/master/src/types)

> _trackNumber_: boolean <true|false>

If true track number will be added to file name like this `01 - Title, 02 - Title` and so on. If false number will be omitted.

> coverSize

Album cover size in number for metadata tagging. Acceptable values are between 50-1800.

- `.128` for 128kbps,
- `.320` for 320kbps,
- `.flac` for flac,
